package cn.wolfcode.shop.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
@Setter
public class SkuProperty extends BaseDomain{
    /*
      类别：下拉框
   */
    public static final Integer PROPERTY_TYPE_SELECT=1;
    /*
        类别：输入框
     */
    public static final Integer PROPERTY_TYPE_INPUT=0;

    private Long catalogId;

    private String name;

    private Integer type;

    private Integer sort;

    private List<SkuPropertyValue> propertyValueList;

    public String getJson(){
        Map map=new HashMap();
        map.put("id",getId());
        map.put("catalogId",this.catalogId);
        map.put("name",this.name);
        map.put("sort",this.sort);
        map.put("type",this.type);
        return JSON.toJSONString(map);
    }
}